home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / ProcDoggie 1.0a6 / About ProcDoggie next >
Encoding:
Text File  |  1991-02-07  |  6.9 KB  |  169 lines  |  [TEXT/MPS ]

  1. Macintosh
  2. Sample Code Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. System Software 7.0b1 Sample Code: ProcDoggie  
  7.  
  8. by Forrest Tanaka
  9.  
  10. Versions:
  11.                 1.0a3                   November 3,  1990
  12.                 1.0a5                    December 18, 1990
  13.                 1.0a6                    February 7,  1991
  14.  
  15. Components:
  16.                 ProcDoggie.make            February 7, 1991
  17.                 ProcDoggie.p            February 7, 1991
  18.                 ProcDoggie.r            February 7, 1991
  19.                 ProcDoggie.rsrc            January 27, 1991
  20.                 UDialogUtils.inc1.p        February 7, 1991
  21.                 UDialogUtils.p            February 7, 1991
  22.                 UEmergMem.inc1.p        February 7, 1991
  23.                 UEmergMem.p                February 7, 1991
  24.                 UGlobals.inc1.p            February 7, 1991
  25.                 UGlobals.p                February 7, 1991
  26.                 UMenuHandler.inc1.p        February 7, 1991
  27.                 UMenuHandler.p            February 7, 1991
  28.                 UProcessGuts.inc1.p        February 7, 1991
  29.                 UProcessGuts.p            February 7, 1991
  30.                 UProcessLDEF.inc1.p        February 7, 1991
  31.                 UProcessLDEF.p            February 7, 1991
  32.                 UProcessUtils.inc1.p    February 7, 1991
  33.                 UProcessUtils.p            February 7, 1991
  34.  
  35. _______________________________________________________________________________
  36.  
  37. Description
  38.  
  39.     System Software 7.0 includes the Process Manager which allows programs to
  40.     launch applications and desk accessories, and to get information about
  41.     other applications and desk accessores that have been launched (both
  42.     generically known as “processes”).
  43.  
  44.     ProcDoggie is a sample application that demonstrates typical uses of the
  45.     Process Manager.  When ProcDoggie is launched, a window appears which
  46.     displays a list of all processes that are active on the machine that
  47.     ProcDoggie is running on.  I call this the “Process List window.”  The user
  48.     can click on any of the processes in the Process List window to select that
  49.     process, and can shift-click or command-click to select more than one
  50.     process.
  51.  
  52.     When one or more processes are selected, the user can either view
  53.     information about those processes, bring those processes to the front, or
  54.     terminate those processes.  Of course, only one process can be at the front
  55.     at any time, so each of the selected processes are brought to the front in
  56.     turn.
  57.  
  58.     When the user chooses to view information about the selected processes, a
  59.     window which I call the “Process Info window” is opened for each of the
  60.     selected processes.  This window displays information about the type and
  61.     creator of the process, whether the process is an application or desk
  62.     accessory, how large its partition is, how much memory it’s using, and
  63.     the status of the flags in its SIZE resource.
  64.  
  65.     The File menu contains commands that the user can use to launch
  66.     applications and desk accessories.  The user can launch an application or
  67.     desk accessory so that it becomes the front process, or the user can launch
  68.     an application so that it becomes a background process, or the user can
  69.     launch an application or desk accessory and then terminate ProcDoggie.
  70.  
  71.     Additionally, the user can choose whether a simple launch is performed or
  72.     whether the launch should specify documents to be opened or printed by the
  73.     launched application.
  74.  
  75.     Thanks to Jeff Hokit for inspiring the name.
  76.  
  77.  
  78. Version 1.0a1
  79. Date unknown by Forrest Tanaka
  80.  
  81.     This version had all features except the ability to terminate processes
  82.     implemented, but very little of the user interface was implemented.  Never
  83.     released to AppleLink
  84.  
  85.  
  86. Version 1.0a2
  87. Date unknown by Forrest Tanaka
  88.  
  89.     The same features were there, but the user interface was much more complete.
  90.     Never released to AppleLink.
  91.  
  92. Version 1.0a3
  93. November 3, 1990 by Forrest Tanaka
  94.  
  95.     This version has features as described above with the exception of being
  96.     able to terminate selected processes.  Readied for release on AppleLink on
  97.     November 3.
  98.  
  99. Version 1.0a4
  100. No date
  101.  
  102.     This version never existed.  I renumbered everything as 1.0a5 by mistake.
  103.  
  104. Version 1.0a5
  105. December 18, 1990 by Forrest Tanaka
  106.  
  107.     •    The ability to terminate selected processes has been added.
  108.     •    Error-checking and recovery has been massively improved.  In theory,
  109.         ProcDoggie should never bomb with any kind of error.
  110.     •    High-level events are now accepted, though only 'quit' AppleEvents are
  111.         handled because ProcDoggie has no documents.
  112.     •    Previously, ProcDoggie didn’t send 'oapp' events to applications which
  113.         were high-level event aware, nor did it properly send 'odoc' events to
  114.         those applications.  These problems have been fixed.
  115.     •    The Utilities sample code unit is no longer used.  All the Utilities
  116.         functionality I was using has been absorbed into ProcDoggie.
  117.     •    If an alert is about to be presented while ProcDoggie is in the back-
  118.         ground, the Notification Manager is used to alert the user that
  119.         ProcDoggie has something to say.
  120.     •    Readied for release on AppleLink on December 18.
  121.  
  122. Version 1.0a6
  123. February 6, 1991 by Forrest Tanaka
  124.  
  125.     •    DrawMenuBar bombs after I send a quit event to MacPaint (and a few
  126.         other applications) and then delete the selected row in the process
  127.         list.  So I changed the DrawMenuBar call to InvalMenuBar and it seems to
  128.         work around the problem.  I don’t know why DrawMenuBar has a problem in
  129.         this specific case involving the Menu, AppleEvent, and List managers.
  130.     •    In InstallDialogItems, I was calling GetIndString with an index of 0 if
  131.         there isn’t a specified font name.  GetIndString bombs under 7.0b4 if
  132.         you do that so now I check for this case.
  133.     •    My LDEF was drawing a cell even if the specified length of the cell’s
  134.         data was 0.  That caused garbage to appear in new cells until I set a
  135.         real value in the cell.  Now, I don’t draw the cell if the length of the
  136.         cell’s data is 0.
  137.     •    I think my LDEF now draws the process names from right aligned on a
  138.         bidirectional script system.  Since I don’t have a bidirectional 7.0
  139.         script system, I can’t test this yet.
  140.     •    Because of a bug in file filtering in 7.0b1, I used SFGetFile instead of
  141.         StandardGetFile.  With 7.0b1 dead and buried, I’m now using
  142.         StandardGetFile.
  143.     •    Dammit Jim!  I’m a C programmer, not a Pascal programmer.  I turned off
  144.         range checking in all the source code files.
  145.     •    I eliminated the UWindowHandler unit and moved the routines that were in
  146.         it to ProcDoggie.p and the UGlobals unit.
  147.  
  148. Coverage
  149. This sample code additionally shows:
  150.  
  151.     •    simple use of the Notification Manager
  152.     •    MacApp-like menu enabling and disabling
  153.     •    use of the International Utilities to display formatted numbers
  154.     •    writing a simple single-line replacement for TextBox
  155.     •    how to read a DITL resource
  156.     •    use of courteous colors in a palette
  157.     •    simple use of MakeRGBPat to display proper colors regardless of the
  158.         depth of a screen
  159.     •    simple cases of taking advantage of Color QuickDraw while still running
  160.         on classic QuickDraw machines
  161.     •    sending 'oapp' and 'quit' AppleEvents to other applications running on
  162.         the same machine
  163.     •    accepting 'quit' AppleEvents
  164.     •    simple use of the List Manager
  165.     •    writing a custom LDEF
  166.     •    using a grow-zone proc to handle low-memory situations
  167.     
  168. _______________________________________________________________________________
  169.